3.45 \(\int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx\)

Optimal. Leaf size=83 \[ \frac{6 a^2 b^2 \tan (c+d x)}{d}+\frac{4 a^3 b \log (\tan (c+d x))}{d}-\frac{a^4 \cot (c+d x)}{d}+\frac{2 a b^3 \tan ^2(c+d x)}{d}+\frac{b^4 \tan ^3(c+d x)}{3 d} \]

[Out]

-((a^4*Cot[c + d*x])/d) + (4*a^3*b*Log[Tan[c + d*x]])/d + (6*a^2*b^2*Tan[c + d*x])/d + (2*a*b^3*Tan[c + d*x]^2
)/d + (b^4*Tan[c + d*x]^3)/(3*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0581838, antiderivative size = 83, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {3516, 43} \[ \frac{6 a^2 b^2 \tan (c+d x)}{d}+\frac{4 a^3 b \log (\tan (c+d x))}{d}-\frac{a^4 \cot (c+d x)}{d}+\frac{2 a b^3 \tan ^2(c+d x)}{d}+\frac{b^4 \tan ^3(c+d x)}{3 d} \]

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]^2*(a + b*Tan[c + d*x])^4,x]

[Out]

-((a^4*Cot[c + d*x])/d) + (4*a^3*b*Log[Tan[c + d*x]])/d + (6*a^2*b^2*Tan[c + d*x])/d + (2*a*b^3*Tan[c + d*x]^2
)/d + (b^4*Tan[c + d*x]^3)/(3*d)

Rule 3516

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[(x^m*(a + x)^n)/(b^2 + x^2)^(m/2 + 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx &=\frac{b \operatorname{Subst}\left (\int \frac{(a+x)^4}{x^2} \, dx,x,b \tan (c+d x)\right )}{d}\\ &=\frac{b \operatorname{Subst}\left (\int \left (6 a^2+\frac{a^4}{x^2}+\frac{4 a^3}{x}+4 a x+x^2\right ) \, dx,x,b \tan (c+d x)\right )}{d}\\ &=-\frac{a^4 \cot (c+d x)}{d}+\frac{4 a^3 b \log (\tan (c+d x))}{d}+\frac{6 a^2 b^2 \tan (c+d x)}{d}+\frac{2 a b^3 \tan ^2(c+d x)}{d}+\frac{b^4 \tan ^3(c+d x)}{3 d}\\ \end{align*}

Mathematica [A]  time = 1.16045, size = 162, normalized size = 1.95 \[ -\frac{\csc (c+d x) \sec ^3(c+d x) \left (4 \left (3 a^4+b^4\right ) \cos (2 (c+d x))+\left (18 a^2 b^2+3 a^4-b^4\right ) \cos (4 (c+d x))+3 \left (8 a b \sin (2 (c+d x)) \left (-a^2 \log (\sin (c+d x))+a^2 \log (\cos (c+d x))-b^2\right )-6 a^2 b^2+4 a^3 b \sin (4 (c+d x)) (\log (\cos (c+d x))-\log (\sin (c+d x)))+3 a^4-b^4\right )\right )}{24 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]^2*(a + b*Tan[c + d*x])^4,x]

[Out]

-(Csc[c + d*x]*Sec[c + d*x]^3*(4*(3*a^4 + b^4)*Cos[2*(c + d*x)] + (3*a^4 + 18*a^2*b^2 - b^4)*Cos[4*(c + d*x)]
+ 3*(3*a^4 - 6*a^2*b^2 - b^4 + 8*a*b*(-b^2 + a^2*Log[Cos[c + d*x]] - a^2*Log[Sin[c + d*x]])*Sin[2*(c + d*x)] +
 4*a^3*b*(Log[Cos[c + d*x]] - Log[Sin[c + d*x]])*Sin[4*(c + d*x)])))/(24*d)

________________________________________________________________________________________

Maple [A]  time = 0.063, size = 90, normalized size = 1.1 \begin{align*}{\frac{{b}^{4} \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{3\,d \left ( \cos \left ( dx+c \right ) \right ) ^{3}}}+2\,{\frac{{b}^{3}a}{d \left ( \cos \left ( dx+c \right ) \right ) ^{2}}}+6\,{\frac{{a}^{2}{b}^{2}\tan \left ( dx+c \right ) }{d}}+4\,{\frac{b{a}^{3}\ln \left ( \tan \left ( dx+c \right ) \right ) }{d}}-{\frac{{a}^{4}\cot \left ( dx+c \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x)

[Out]

1/3/d*b^4*sin(d*x+c)^3/cos(d*x+c)^3+2/d*b^3*a/cos(d*x+c)^2+6*a^2*b^2*tan(d*x+c)/d+4*a^3*b*ln(tan(d*x+c))/d-a^4
*cot(d*x+c)/d

________________________________________________________________________________________

Maxima [A]  time = 1.12037, size = 97, normalized size = 1.17 \begin{align*} \frac{b^{4} \tan \left (d x + c\right )^{3} + 6 \, a b^{3} \tan \left (d x + c\right )^{2} + 12 \, a^{3} b \log \left (\tan \left (d x + c\right )\right ) + 18 \, a^{2} b^{2} \tan \left (d x + c\right ) - \frac{3 \, a^{4}}{\tan \left (d x + c\right )}}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

1/3*(b^4*tan(d*x + c)^3 + 6*a*b^3*tan(d*x + c)^2 + 12*a^3*b*log(tan(d*x + c)) + 18*a^2*b^2*tan(d*x + c) - 3*a^
4/tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 2.04927, size = 389, normalized size = 4.69 \begin{align*} -\frac{6 \, a^{3} b \cos \left (d x + c\right )^{3} \log \left (\cos \left (d x + c\right )^{2}\right ) \sin \left (d x + c\right ) - 6 \, a^{3} b \cos \left (d x + c\right )^{3} \log \left (-\frac{1}{4} \, \cos \left (d x + c\right )^{2} + \frac{1}{4}\right ) \sin \left (d x + c\right ) - 6 \, a b^{3} \cos \left (d x + c\right ) \sin \left (d x + c\right ) +{\left (3 \, a^{4} + 18 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{4} - b^{4} - 2 \,{\left (9 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{2}}{3 \, d \cos \left (d x + c\right )^{3} \sin \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

-1/3*(6*a^3*b*cos(d*x + c)^3*log(cos(d*x + c)^2)*sin(d*x + c) - 6*a^3*b*cos(d*x + c)^3*log(-1/4*cos(d*x + c)^2
 + 1/4)*sin(d*x + c) - 6*a*b^3*cos(d*x + c)*sin(d*x + c) + (3*a^4 + 18*a^2*b^2 - b^4)*cos(d*x + c)^4 - b^4 - 2
*(9*a^2*b^2 - b^4)*cos(d*x + c)^2)/(d*cos(d*x + c)^3*sin(d*x + c))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)**2*(a+b*tan(d*x+c))**4,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 2.64793, size = 116, normalized size = 1.4 \begin{align*} \frac{b^{4} \tan \left (d x + c\right )^{3} + 6 \, a b^{3} \tan \left (d x + c\right )^{2} + 12 \, a^{3} b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + 18 \, a^{2} b^{2} \tan \left (d x + c\right ) - \frac{3 \,{\left (4 \, a^{3} b \tan \left (d x + c\right ) + a^{4}\right )}}{\tan \left (d x + c\right )}}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x, algorithm="giac")

[Out]

1/3*(b^4*tan(d*x + c)^3 + 6*a*b^3*tan(d*x + c)^2 + 12*a^3*b*log(abs(tan(d*x + c))) + 18*a^2*b^2*tan(d*x + c) -
 3*(4*a^3*b*tan(d*x + c) + a^4)/tan(d*x + c))/d